Skip to content

Conversation

duanyangjing
Copy link
Collaborator

No description provided.

@duanyangjing duanyangjing force-pushed the fix-string_indexOfChar-intrinsic branch from bd83315 to c97803b Compare September 12, 2025 06:43
#endif
break;
case Op_StrEquals:
// We already know that cnt1 == cnt2 here (checked in 'inline_string_equals').
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • caller 里是不是也要改一下?LibraryCallKit::inline_string_equals
  • 这里每一个分支都有个 #if, 直接拆成两个 switch 是不是可读性更高些
#if
switch (...) {
....

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • caller 里是不是也要改一下?LibraryCallKit::inline_string_equals
  • 这里每一个分支都有个 #if, 直接拆成两个 switch 是不是可读性更高些
#if
switch (...) {
....

Fixed, 考虑到函数开头还有assert,把整个函数都提取成了两个版本。感觉需要等到这里的修复提交后再跑下测试再合入

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

对了,能加个测试验证下这个改动吗?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

对了,能加个测试验证下这个改动吗?

加了String.contains的测试,inline_string_equals加了unreachable

@duanyangjing duanyangjing force-pushed the fix-string_indexOfChar-intrinsic branch from c97803b to 8d66fe6 Compare September 15, 2025 03:37
@duanyangjing duanyangjing changed the title hotspot: fix intrinsic String.indexOfChar hotspot: fix intrinsic String.indexOfChar, String.equals Sep 15, 2025
@duanyangjing duanyangjing changed the title hotspot: fix intrinsic String.indexOfChar, String.equals hotspot: fix intrinsic String.indexOfChar Sep 16, 2025
@duanyangjing duanyangjing changed the title hotspot: fix intrinsic String.indexOfChar hotspot: fix intrinsic String.indexOf Sep 16, 2025
@duanyangjing duanyangjing force-pushed the fix-string_indexOfChar-intrinsic branch 2 times, most recently from b42ea4b to 387f20a Compare September 16, 2025 06:55

virtual bool depends_only_on_test() const { return false; }
virtual const TypePtr* adr_type() const { return TypeAryPtr::BYTES; }
virtual const TypePtr* adr_type() const { return TypeAryPtr::CHARS; }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#if TARGET_CLASSLIB == 8
virtual const TypePtr* adr_type() const { return TypeAryPtr::CHARS; }
#else
virtual const TypePtr* adr_type() const { return TypeAryPtr::BYTES; }
#endif

@duanyangjing duanyangjing force-pushed the fix-string_indexOfChar-intrinsic branch from 387f20a to 5b2016e Compare September 24, 2025 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants